//
// Created by Administrator on 2023/8/4.
//
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <unordered_set>

using namespace std;


class Solution {
public:
    int distinctAverages(vector<int> &nums) {
        unordered_set<float> set;
        // 先对nums排序
        sort(nums.begin(), nums.end());
        // 首尾数字的平均数
        for (int i = 0, j = nums.size() - 1; i < j; i++, j--) {
            set.insert((float) (nums[i] + nums[j]) / 2);
        }
        return set.size();
    }
};


int main() {
    Solution s;
    vector<int> nums = {4,1,4,0,3,5};
    cout << s.distinctAverages(nums) << endl;
    return 0;
}
